var app = {
    init:function(){
        this.param = {
            userName:"",
            password:""
        }
        this.bindEvent();
    },
    bindEvent:function(){
        // $(document).on("click",".tabs span",function(){
        //     $(this).siblings().removeClass('active');
        //     $(this).addClass('active');
        // })
        var that = this;
        $(document).on("click",".login-btn",function(){
            that.checkLogin();
        })
        
    },
    checkLogin:function(){
        var that = this;
        this.param.userName = $("[name=userName]").val();
        this.param.password = $("[name=password]").val();
        this.param.password = hex_md5(this.param.password);
        $.ajax({
            url:'/api/v1/meteorology/user/login',
            type:'post',
            data:this.param,
            success:function(res){
                if(res.errcode == "0000"){
                    window.location.href = "./index.html";
                }else{
                    layer.msg(res.errmsg);
                }
            },
            error:function(){

            }
        });
    }
}

app.init();